Note: This tutorial assumes that you have completed the previous tutorials: ROS tutorials. |
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
phm_tools Tutorial
Description: This tutorial explains how to install the phm_tools metapackage and use it.Tutorial Level: INTERMEDIATE
PHM Tool Installation
This section describes how to download the dependencies required for the installation of PHM Tool and run PHM Tool.
First, a workspace needs to be created. If there is no workspace, a workspace should be created by following the instructions in the Create a workspace link.
If the workspace has been created, you should go to the workspace directory in the terminal.
$ cd ~/catkin_ws/src
Then Phm Tool is downloaded.
$ git clone "https://github.com/inomuh/phm_tools.git"
The required PyQT5 and matplotlib dependencies must be downloaded for Phm Tool to work after it is downloaded.
$ sudo apt-get install python3-pyqt5 $ sudo apt-get install python3-matplotlib
Because it is high in size, go to the rosbag file (.zip) and extract.
$ cd ~/catkin_ws/src/phm_tools/phm_rosbag $ unzip rosbag_sample.bag.zip
After downloading the dependencies, go to the workspace and compile it.
$ cd ~/catkin_ws $ catkin_make $ catkin_make install
How to run the program?
After compiling the workspace, start to run PHM Tool. A new terminal is opened and roscore is opened.
$ roscore
A new terminal opens after running the roscore command. Phm Tool is run in this terminal.
$ roslaunch phm_start phm_start.launch
To configure the system, you can follow the document or watch the video in the PHM Tools link. Sensors from rosbag should be added to the system after configuring the system.
A new terminal opens, goes to the location where rosbag is and opens the rosbag. Sensors are added to the modules as in the video.
$ cd ~/catkin_ws/src/phm_tools/phm_rosbag $ rosbag play rosbag_sample.bag
For Task Completion Analysis, task data must come from the smach included in the simulation package. If there is no simulation, the "Task Completion Analysis" tab can be applied with the following commands.
For Predict Analysis and Prognostic Analysis in Real Time Analysis, messages must be published from /robot_task_list topc.
$ rostopic pub /robot_task_list std_msgs/String "data: '[[4.25, 2.18, 0.305032286643936], [4.25, 3.1, 0.34244299963151925], [4.25, 2.18, 0.3130261708222558], [5.55, 3.54, 0.25665934871261936], [7.29, 3.53, 0.3099463716242755], [10.34, 3.91, 0.33396332918153804], [11.05, 3.67, 0.34579751666395014], [11.42, 2.76, 0.34335229915257853], [11.42, 1.93, 0.32025931883120473], [10.97, 1.08, 0.2732565117783081], [8.16, 0.82, 0.3424904966267803], [6.35, 0.83, 0.3364506314969207], [4.26, 0.68, 0.30230026016025063]]'" -1
For Actual Analysis in Real Time Analysis section, messages from /task_time and /task_position topics must be published.
$ rostopic pub /task_time std_msgs/String "data: '[7.070728063583374, 7.325403928756714, 3.0024330615997314, 5.1106040477752686, 10.97532606124878, 12.948495864868164, 3.0029280185699463, 17.01675295829773, 3.674638032913208, 4.787661075592041, 4.183042049407959, 4.751224040985107, 16.489573001861572, 10.011996984481812, 17.285614013671875]'" -1
$ rostopic pub /task_position std_msgs/String "data: '[[4.173425111935546, 0.6996212725439405], [4.252327779615457, 1.7887780478495028], [4.254796821506879, 2.986813819580745], [4.254796821506879, 2.986813819580745], [4.075966735712705, 2.45786878651297], [5.296776265140758, 3.2377047247386685], [7.186286384259671, 3.4575905505176574], [7.186286384259671, 3.4575905505176574], [10.02707803637877, 3.834368378077772], [10.713219522235965, 3.6906226762430725], [11.321258808297841, 3.0485739135240486], [11.451096448575916, 2.271822575810481], [11.191486774449103, 1.4076532146026228], [8.491930981852743, 0.7301303113520736], [6.714700980072448, 0.7608179284539074], [4.405262763785259, 0.5861917110532081]]'" -1